#pragma once 

#define DIE(num) ::exit(num)
#include <fcntl.h>
#include <iostream>
#include <cstdlib>

void SetNonBlock(int fd)
{
    int n = ::fcntl(fd,F_GETFL);
    if (n < 0)
    {
        std::cerr << "获取文件描述符属性失败" << std::endl;
        exit(1);
    }
    ::fcntl(fd,F_SETFL,fd|O_NONBLOCK);
}

enum 
{
    EPOLL_CREATE_ERROR,
};